package com.newegg.whois.model;

import java.util.List;

public class DomainInfo {
	String tld;
	String domain;
	String subdomain;
	
	List<String> whoisServers;
	
	public String getTld() {
		return tld;
	}
	public void setTld(String tld) {
		this.tld = tld;
	}
	public String getDomain() {
		return domain;
	}
	public void setDomain(String domain) {
		this.domain = domain;
	}
	public String getSubdomain() {
		return subdomain;
	}
	public void setSubdomain(String subdomain) {
		this.subdomain = subdomain;
	}
	public List<String> getWhoisServers() {
		return whoisServers;
	}
	public void setWhoisServers(List<String> whoisServers) {
		this.whoisServers = whoisServers;
	}
	public String getSubDomainName() {
		if(domain == null){ return null; }
		if(subdomain == null){ subdomain = "www"; }
		return subdomain + "." + domain + "." + tld;
	}
	public String getDomainName() {
		if(domain == null){ return null; }
		return domain + "." + tld;
	}
	
	@Override
	public String toString() {
		return "DomainInfo [tld=" + tld + ", domain=" + domain + ", subdomain=" + subdomain + ", whoisServers="
				+ whoisServers + "]";
	}
}
